home *** CD-ROM | disk | FTP | other *** search
/ Champak 64 / Volume 64 - JOGO DISK .iso / Games / skecthpad.swf / scripts / frame_35 / DoAction_2.as next >
Text File  |  2008-04-25  |  872b  |  37 lines

  1. this.color_mixer.onEnterFrame = function()
  2. {
  3.    i = 1;
  4.    while(i <= 3)
  5.    {
  6.       this["hexc" + i + "Text"].onKillFocus = function()
  7.       {
  8.          hexMode = false;
  9.       };
  10.       this["hexc" + i + "Text"].onSetFocus = function()
  11.       {
  12.          hexMode = true;
  13.       };
  14.       fader = this["fader" + i].knob;
  15.       if(dragging)
  16.       {
  17.          this["c" + i] = fader._y * 3.6428;
  18.          this["hc" + i] = this["c" + i].toString(16);
  19.       }
  20.       else if(hexMode)
  21.       {
  22.          fader._y = parseInt("0x" + this["hc" + i]);
  23.          this["c" + i] = parseInt("0x" + this["hc" + i]);
  24.       }
  25.       else
  26.       {
  27.          fader._y = this["c" + i] / 3.6428;
  28.          this["hc" + i] = Number(this["c" + i]).toString(16);
  29.          if(this["c" + i] > 255)
  30.          {
  31.             this["c" + i] = 255;
  32.          }
  33.       }
  34.       i++;
  35.    }
  36. };
  37.